package com.doumi.biz.qadev.api.testcase;

import com.doumi.qadev.methods.RestAssured;
import io.restassured.path.json.JsonPath;
import org.testng.Reporter;

import java.util.HashMap;

/**
 * Created by YDZ on 2019/11/20.
 */
public class RequestTemplate {
    /**
     * 请求/common/filter
     * @return 接口返回结果
     */
    private RestAssured restAssured = new RestAssured();
    public JsonPath postCommonFilter(HashMap parms){
        String hostAndPort ="http://10.216.91.27:8096";
        String url="/common/filter";
        parms.put("companyId","11111");
        parms.put("postId","12");
        parms.put("requestId","12312314214");
        JsonPath jsonPath = restAssured.getJson(hostAndPort,url,parms);
        Reporter.log("接口返回值为"+jsonPath.prettify());
        return jsonPath;
    }

    public JsonPath getHistoryAdd(HashMap parms){
//        String hostAndPort ="http://10.216.102.215:8089";
        String hostAndPort ="http://10.216.91.27:8096";
        String url="/history/add";
        parms.put("requestId","12312314214");
        parms.put("cityId","12");
        parms.put("jobTypeId","18");
        parms.put("companyId","11111");
        JsonPath jsonPath = restAssured.getJson(hostAndPort,url,parms);
        Reporter.log("接口返回值为"+jsonPath.prettify());
        return jsonPath;
    }
    public JsonPath getHistoryFilter(HashMap parms){
        String hostAndPort ="http://10.216.91.27:8096";
//        String hostAndPort ="http://10.216.102.215:8089";
        String url="/history/filter";
        parms.put("cityId","12");
        parms.put("buserId","21314");
        parms.put("companyId","11111");
        parms.put("jobTypeId","18");
        parms.put("requestId","12312314214");
        JsonPath jsonPath = restAssured.getJson(hostAndPort,url,parms);
        Reporter.log("接口返回值为"+jsonPath.prettify());
        return jsonPath;
    }
public JsonPath getMobileCheck(HashMap parms){
        String hostAndPort ="http://10.216.91.27:8096";
        String url="/mobile/check";
        JsonPath jsonPath = restAssured.getJson(hostAndPort,url,parms);
        Reporter.log("接口返回值为"+jsonPath.prettify());
        return jsonPath;
    }
}
